import request from '@/utils/request'

// 查询商品列表
export function listData(query) {
  return request({
    url: '/config/product/',
    method: 'get',
    params: query
  })
}


// 查询全部商品
export function listAllData(query) {
  return request({
    url: '/config/product/refer',
    method: 'get',
    params:query
  })
}



// 查询商品详细
export function getDetail(id) {
  return request({
    url: '/config/product/' + id,
    method: 'get'
  })
}


// 新增商品
export function addData(data) {
  return request({
    url: '/config/product/',
    method: 'post',
    data: data
  })
}

// 修改商品
export function updateData(data) {
  return request({
    url: '/config/product/',
    method: 'put',
    data: data
  })
}

// 删除商品
export function delData(id) {
  return request({
    url: '/config/product/' + id,
    method: 'delete'
  })
}

// 查询所有商品
export function getAllProduct(query) {
  return request({
    url: '/config/product/refer',
    method: 'get',
    params:query
  })
}


// 查询所有仓库商品
export function getAllWarehouseProduct(query) {
  return request({
    url: '/config/product/warehouseRefer' ,
    method: 'get',
    params: query
  })
}

// 修改商品状态
export function updateEnable(data) {
  return request({
    url: '/config/product/enable',
    method: 'put',
    data: data
  })
}
